home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-09 | 5.2 KB | 202 lines | [TEXT/MPS ] |
- ; ===========================================
- ; Copyright Paul Baxter
- ; ===========================================
- Include 'Traps.a'
- Include 'SCSIEqu.a'
- Include 'SysErr.a'
-
- CASE OFF
-
- SCSITRAPNUM EQU $A815
-
- ; ===========================================
- ; routine selectors
- ; ===========================================
- start_rec EQU 512
- stop_rec EQU 513
- clear_rec EQU 514
- send_rec EQU 515
-
- MACRO
- _SCSIStartRecord
- MOVE #start_rec,-(SP)
- _SCSIDispatch
- ENDM
-
- MACRO
- _SCSIStopRecord
- MOVE #stop_rec,-(SP)
- _SCSIDispatch
- ENDM
-
- MACRO
- _SCSIInitRecord
- MOVE #clear_rec,-(SP)
- _SCSIDispatch
- ENDM
-
- MACRO
- _SCSISendRecord
- MOVE #send_rec,-(SP)
- _SCSIDispatch
- ENDM
-
- SCSIPatchAvail PROC EXPORT
-
- StackFrame RECORD {A6Link},DECR ; build a stack frame record
- Result DS.W 1 ; function's result returned to caller
- RetAddr DS.L 1 ; place holder for return address
- A6Link DS.L 1 ; place holder for A6 link
- LocalSize EQU * ; size of all the local variables
- ENDR
-
- WITH StackFrame ; cover our local stack frame
- LINK A6,#LocalSize ; allocate our local stack frame
- MOVE.W #SCSITRAPNUM,D0; _SCSIDispatch Trap
- _GetTrapAddress newTool
- MOVE.W #-1,D0
- SUBA.L #16,A0
-
- CMPI.L #'PTCH',(A0)
- BNE.S @trap_not_available
-
- ADDQ.L #4,A0
- CMPI.L #'SCSI',(A0)
- BEQ.S @trap_available
-
- @trap_not_available
- MOVEQ.L #0,D0
- @trap_available
- MOVE.W D0,Result(A6)
- UNLK A6 ; destroy the link
- MOVEA.L (SP)+,A0 ; pull off the return address
- JMP (A0) ; return to the caller
- ENDP
-
- SCSIStartRecord PROC EXPORT
-
- StackFrame RECORD {A6Link},DECR ; build a stack frame record
- Result DS.W 1 ; function's result returned to caller
- RetAddr DS.L 1 ; place holder for return address
- A6Link DS.L 1 ; place holder for A6 link
- LocalSize EQU * ; size of all the local variables
- ENDR
-
- WITH StackFrame ; cover our local stack frame
- LINK A6,#LocalSize ; allocate our local stack frame
-
- SUBQ.L #2,SP ; First see if our Patch is installed
- BSR SCSIPatchAvail
- MOVE.W (SP)+,D1
- MOVE.W #unimpErr,D0
- TST.W D1
- BEQ.S @exit ; It's not here
-
- SUBQ.L #2,SP
- _SCSIStartRecord
- MOVE.W (SP)+,D0
- @exit
- MOVE.W D0,Result(A6)
- UNLK A6 ; destroy the link
- MOVEA.L (SP)+,A0 ; pull off the return address
- JMP (A0) ; return to the caller
- ENDP
-
- SCSIStopRecord PROC EXPORT
-
- StackFrame RECORD {A6Link},DECR ; build a stack frame record
- Result DS.W 1 ; function's result returned to caller
- RetAddr DS.L 1 ; place holder for return address
- A6Link DS.L 1 ; place holder for A6 link
- LocalSize EQU * ; size of all the local variables
- ENDR
-
- WITH StackFrame ; cover our local stack frame
- LINK A6,#LocalSize ; allocate our local stack frame
-
- SUBQ.L #2,SP ; First see if our Patch is installed
- BSR SCSIPatchAvail
- MOVE.W (SP)+,D1
- MOVE.W #unimpErr,D0
- TST.W D1
- BEQ.S @exit ; It's not here
-
- SUBQ.L #2,SP
- _SCSIStopRecord
- MOVE.W (SP)+,D0
- @exit
- MOVE.W D0,Result(A6)
- UNLK A6 ; destroy the link
- MOVEA.L (SP)+,A0 ; pull off the return address
- JMP (A0) ; return to the caller
- ENDP
-
- SCSIInitRecord PROC EXPORT
-
- StackFrame RECORD {A6Link},DECR ; build a stack frame record
- Result DS.W 1 ; function's result returned to caller
- RetAddr DS.L 1 ; place holder for return address
- A6Link DS.L 1 ; place holder for A6 link
- LocalSize EQU * ; size of all the local variables
- ENDR
-
- WITH StackFrame ; cover our local stack frame
- LINK A6,#LocalSize ; allocate our local stack frame
-
- SUBQ.L #2,SP ; First see if our Patch is installed
- BSR SCSIPatchAvail
- MOVE.W (SP)+,D1
- MOVE.W #unimpErr,D0
- TST.W D1
- BEQ.S @exit ; It's not here
-
- SUBQ.L #2,SP
- _SCSIInitRecord
- MOVE.W (SP)+,D0
- @exit
- MOVE.W D0,Result(A6)
- UNLK A6 ; destroy the link
- MOVEA.L (SP)+,A0 ; pull off the return address
- JMP (A0) ; return to the caller
- ENDP
-
-
- SCSISendRecord PROC EXPORT
-
- StackFrame RECORD {A6Link},DECR ; build a stack frame record
- Result DS.W 1 ; function's result returned to caller
- ParamBegin EQU * ; start parameters after this point
- Buffer DS.L 1 ; the first parameter on the stack
- Count DS.L 1 ; the second parameter on the stack
- ParamSize EQU ParamBegin-* ; size of all the passed parameters
- RetAddr DS.L 1 ; place holder for return address
- A6Link DS.L 1 ; place holder for A6 link
- LocalSize EQU * ; size of all the local variables
- ENDR
-
- WITH StackFrame ; cover our local stack frame
- LINK A6,#LocalSize ; allocate our local stack frame
-
- SUBQ.L #2,SP ; First see if our Patch is installed
- BSR SCSIPatchAvail
- MOVE.W (SP)+,D1
- MOVE.W #unimpErr,D0
- TST.W D1
- BEQ.S @exit ; It's not here
-
- SUBQ.L #2,SP
- MOVE.L Buffer(A6),-(SP)
- MOVE.L Count(A6),-(SP)
- _SCSISendRecord
- MOVE.W (SP)+,D0
- @exit
- MOVE.W D0,Result(A6)
- UNLK A6 ; destroy the link
- MOVEA.L (SP)+,A0 ; pull off the return address
- ADDQ.L #ParamSize,SP ; strip all of the caller's parameters
- JMP (A0) ; return to the caller
- ENDP
- End
-
- asm "{Active}" -o "{Active}.o"
-